package algorithm.Genetic.Solution;

import algorithm.Genetic.Entity.*;

import java.util.ArrayList;

public class dataAddation {
    Satellity s1;
    Satellity s2;
    Satellity s3;
    Satellity s4;
    Satellity s5;
    public Task[] generateTaskData(){
        Task t1 = new Task();
        Time time1 = new Time();
        ArrayList<Location> L1 = new ArrayList<Location>();
        Location l1= new Location();
        l1.setLatitd(1);
        l1.setAltitd(1);
        l1.setLongtd(1);
        L1.add(l1);
        time1.setTimeStart(1);
        time1.setEndStart(3);
        t1.setName("1");
        t1.setSensor(2);
        t1.setPriority(3);
        t1.setTime(time1);
        t1.setLocation(L1);
        Duration duration1 = new Duration();
        duration1.setDuration(2);
        t1.setDuration(duration1);
        t1.setResolution(5F);

        Task t2 = new Task();
        Time time2 = new Time();
        ArrayList<Location> L2 = new ArrayList<Location>();
        Location l2= new Location();
        l2.setLatitd(1);
        l2.setAltitd(2);
        l2.setLongtd(1);
        L2.add(l2);
        time2.setTimeStart(2);
        time2.setEndStart(8);
        t2.setName("2");
        t2.setSensor(1);
        t2.setPriority(4);
        t2.setTime(time2);
        t2.setLocation(L2);
        Duration duration2 = new Duration();
        duration2.setDuration(1);
        t2.setDuration(duration2);
        t2.setResolution(5F);

        Task t3 = new Task();
        Time time3 = new Time();
        ArrayList<Location> L3 = new ArrayList<Location>();
        Location l3= new Location();
        l3.setLatitd(1);
        l3.setAltitd(2);
        l3.setLongtd(1);
        L3.add(l3);
        time3.setTimeStart(3);
        time3.setEndStart(7);
        t3.setName("3");
        t3.setSensor(2);
        t3.setPriority(5);
        t3.setTime(time3);
        t3.setLocation(L3);
        Duration duration3 = new Duration();
        duration3.setDuration(2);
        t3.setDuration(duration3);
        t3.setResolution(5F);

        Task t4 = new Task();
        Time time4 = new Time();
        ArrayList<Location> L4 = new ArrayList<Location>();
        Location l4= new Location();
        l4.setLatitd(1);
        l4.setAltitd(1);
        l4.setLongtd(1);
        L4.add(l4);
        time4.setTimeStart(6);
        time4.setEndStart(11);
        t4.setName("4");
        t4.setSensor(2);
        t4.setPriority(6);
        t4.setTime(time4);
        t4.setLocation(L4);
        Duration duration4 = new Duration();
        duration4.setDuration(2);
        t4.setDuration(duration4);
        t4.setResolution(5F);

        Task t5 = new Task();
        Time time5 = new Time();
        ArrayList<Location> L5 = new ArrayList<Location>();
        Location l5= new Location();
        l5.setLatitd(1);
        l5.setAltitd(2);
        l5.setLongtd(1);
        L5.add(l5);
        time5.setTimeStart(5);
        time5.setEndStart(15);
        t5.setName("5");
        t5.setSensor(1);
        t5.setPriority(7);
        t5.setTime(time5);
        t5.setLocation(L5);
        Duration duration5 = new Duration();
        duration5.setDuration(3);
        t5.setDuration(duration5);
        t5.setResolution(5F);

        Task[] tasks = new Task[20];
        tasks[0]=t1;
        tasks[1]=t2;
        tasks[2]=t3;
        tasks[3]=t4;
        tasks[4]=t5;
        tasks[5]=t1;
        tasks[6]=t2;
        tasks[7]=t3;
        tasks[8]=t4;
        tasks[9]=t5;
        tasks[10]=t1;
        tasks[11]=t2;
        tasks[12]=t3;
        tasks[13]=t4;
        tasks[14]=t5;
        tasks[15]=t1;
        tasks[16]=t2;
        tasks[17]=t3;
        tasks[18]=t4;
        tasks[19]=t5;

        return tasks;
    }
    public Satellity[] generateSData(){
        generateSData1();
        Satellity[] satellities = new Satellity[20];
        satellities[0] = s1;
        satellities[1] = s2;
        satellities[2] = s3;
        satellities[3] = s3;
        satellities[4] = s1;
        satellities[5] = s1;
        satellities[6] = s2;
        satellities[7] = s3;
        satellities[8] = s3;
        satellities[9] = s1;
        satellities[10] = s1;
        satellities[11] = s2;
        satellities[12] = s3;
        satellities[13] = s3;
        satellities[14] = s1;
        satellities[15] = s1;
        satellities[16] = s2;
        satellities[17] = s3;
        satellities[18] = s3;
        satellities[19] = s1;

        return satellities;
    }
    public void generateSData1(){
        s1 = new Satellity();
        s1.setN("1");
        s1.setMR(20);
        s1.setST(1);
        s1.setMTI(1);
        s2 = new Satellity();
        s2.setN("2");
        s2.setMR(10);
        s2.setST(2);
        s2.setMTI(1);
        s3 = new Satellity();
        s3.setN("3");
        s3.setMR(15);
        s3.setST(2);
        s3.setMTI(1);
        s4 = new Satellity();
        s3.setN("3");
        s3.setMR(15);
        s3.setST(2);
        s3.setMTI(1);


    }
    public ArrayList<SatellityObeseverResource> generateOR(){

        ArrayList<SatellityObeseverResource> satellityObeseverResources = new ArrayList<SatellityObeseverResource>();
        SatellityObeseverResource so1 = new SatellityObeseverResource();
        ArrayList<Location> Ls1 = new ArrayList<Location>();
        Location ls1= new Location();
        ls1.setLatitd(1);
        ls1.setAltitd(2);
        ls1.setLongtd(1);
        Ls1.add(ls1);
        so1.setLocation(Ls1);
        so1.setSAT(s1);
        ArrayList<TW> tws = new ArrayList<TW>();
        TW tw1 = new TW();
        tw1.setTwStartTime(0);
        tw1.setTwEndTime(7);
        TW tw2 = new TW();
        tw2.setTwStartTime(9);
        tw2.setTwEndTime(16);
        tws.add(tw1);
        tws.add(tw2);
        so1.setTW(tws);

        SatellityObeseverResource so2 = new SatellityObeseverResource();
        ArrayList<Location> Ls2 = new ArrayList<Location>();
        Location ls2= new Location();
        ls2.setLatitd(1);
        ls2.setAltitd(1);
        ls2.setLongtd(1);
        Ls2.add(ls2);
        so2.setLocation(Ls2);
        so2.setSAT(s2);
        ArrayList<TW> tws1 = new ArrayList<TW>();
        TW tw11 = new TW();
        tw11.setTwStartTime(0);
        tw11.setTwEndTime(10);
        TW tw22 = new TW();
        tw22.setTwStartTime(11);
        tw22.setTwEndTime(18);
        tws1.add(tw11);
        tws1.add(tw22);
        so2.setTW(tws1);

        SatellityObeseverResource so3 = new SatellityObeseverResource();
        ArrayList<Location> Ls3 = new ArrayList<Location>();
        Location ls3 = new Location();
        ls3.setLatitd(1);
        ls3.setAltitd(2);
        ls3.setLongtd(1);
        Ls3.add(ls3);
        so3.setLocation(Ls3);
        so3.setSAT(s3);
        ArrayList<TW> tws2 = new ArrayList<TW>();
        TW tw33 = new TW();
        tw33.setTwStartTime(0);
        tw33.setTwEndTime(10);
        TW tw44 = new TW();
        tw44.setTwStartTime(11);
        tw44.setTwEndTime(18);
        tws2.add(tw33);
        tws2.add(tw44);
        so3.setTW(tws2);

        SatellityObeseverResource so4 = new SatellityObeseverResource();
        ArrayList<Location> Ls4 = new ArrayList<Location>();
        Location ls4 = new Location();
        ls4.setLatitd(1);
        ls4.setAltitd(2);
        ls4.setLongtd(1);
        Ls4.add(ls4);
        so4.setLocation(Ls4);
        so4.setSAT(s4);
        ArrayList<TW> tws3 = new ArrayList<TW>();
        TW tw55 = new TW();
        tw55.setTwStartTime(0);
        tw55.setTwEndTime(10);
        TW tw66 = new TW();
        tw66.setTwStartTime(11);
        tw66.setTwEndTime(18);
        tws3.add(tw55);
        tws3.add(tw66);
        so4.setTW(tws3);

        satellityObeseverResources.add(so1);
        satellityObeseverResources.add(so2);
        satellityObeseverResources.add(so3);
        satellityObeseverResources.add(so3);
        satellityObeseverResources.add(so1);
        satellityObeseverResources.add(so1);
        satellityObeseverResources.add(so2);
        satellityObeseverResources.add(so3);
        satellityObeseverResources.add(so3);
        satellityObeseverResources.add(so1);
        satellityObeseverResources.add(so1);
        satellityObeseverResources.add(so2);
        satellityObeseverResources.add(so3);
        satellityObeseverResources.add(so3);
        satellityObeseverResources.add(so1);
        satellityObeseverResources.add(so1);
        satellityObeseverResources.add(so2);
        satellityObeseverResources.add(so3);
        satellityObeseverResources.add(so3);
        satellityObeseverResources.add(so1);

        return satellityObeseverResources;
    }
}
